package com.xxxx.web.dto;

import com.xxxx.web.entity.*;
import com.xxxx.web.enums.*;
import com.xxxx.web.tools.dto.BaseDto;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * 货主表类
 */
@Data
public class CustomerDto extends BaseDto {


    /**
     * 联系人
     */
    @JsonProperty("ContactPerson")
    private String ContactPerson;


    /**
     * 联系电话
     */
    @JsonProperty("Phone")
    private String Phone;


    /**
     * 货主名称
     */
    @JsonProperty("OwnerName")
    private String OwnerName;


    /**
     * 地址
     */
    @JsonProperty("Address")
    private String Address;


    /**
     * 电子邮箱
     */
    @JsonProperty("Email")
    private String Email;


    /**
     * 仓库
     */
    @JsonProperty("WarehouseId")
    private Integer WarehouseId;

    @JsonProperty("WarehouseDto")
    private WarehouseDto WarehouseDto;

    /**
     * 把货主表传输模型转换成货主表实体
     */
    public Customer MapToEntity() throws InvocationTargetException, IllegalAccessException {
        Customer Customer = new Customer();

        BeanUtils.copyProperties(Customer, this);

        return Customer;
    }

}
